import 'package:edu_assistant/generated/json/base/json_convert_content.dart';
import 'package:edu_assistant/model/manager_ability_entity.dart';

ManagerAbilityEntity $ManagerAbilityEntityFromJson(Map<String, dynamic> json) {
  final ManagerAbilityEntity managerAbilityEntity = ManagerAbilityEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    managerAbilityEntity.id = id;
  }
  final int? houseManagerUcId = jsonConvert.convert<int>(
      json['houseManagerUcId']);
  if (houseManagerUcId != null) {
    managerAbilityEntity.houseManagerUcId = houseManagerUcId;
  }
  final String? abilityLabel = jsonConvert.convert<String>(
      json['abilityLabel']);
  if (abilityLabel != null) {
    managerAbilityEntity.abilityLabel = abilityLabel;
  }
  final int? validStatus = jsonConvert.convert<int>(json['validStatus']);
  if (validStatus != null) {
    managerAbilityEntity.validStatus = validStatus;
  }
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    managerAbilityEntity.createTime = createTime;
  }
  final int? updateTime = jsonConvert.convert<int>(json['updateTime']);
  if (updateTime != null) {
    managerAbilityEntity.updateTime = updateTime;
  }
  final String? houseManagerDesc = jsonConvert.convert<String>(
      json['houseManagerDesc']);
  if (houseManagerDesc != null) {
    managerAbilityEntity.houseManagerDesc = houseManagerDesc;
  }
  final String? abilityLabelDesc = jsonConvert.convert<String>(
      json['abilityLabelDesc']);
  if (abilityLabelDesc != null) {
    managerAbilityEntity.abilityLabelDesc = abilityLabelDesc;
  }
  return managerAbilityEntity;
}

Map<String, dynamic> $ManagerAbilityEntityToJson(ManagerAbilityEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['houseManagerUcId'] = entity.houseManagerUcId;
  data['abilityLabel'] = entity.abilityLabel;
  data['validStatus'] = entity.validStatus;
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['houseManagerDesc'] = entity.houseManagerDesc;
  data['abilityLabelDesc'] = entity.abilityLabelDesc;
  return data;
}

extension ManagerAbilityEntityExtension on ManagerAbilityEntity {
  ManagerAbilityEntity copyWith({
    int? id,
    int? houseManagerUcId,
    String? abilityLabel,
    int? validStatus,
    int? createTime,
    int? updateTime,
    String? houseManagerDesc,
    String? abilityLabelDesc,
  }) {
    return ManagerAbilityEntity()
      ..id = id ?? this.id
      ..houseManagerUcId = houseManagerUcId ?? this.houseManagerUcId
      ..abilityLabel = abilityLabel ?? this.abilityLabel
      ..validStatus = validStatus ?? this.validStatus
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..houseManagerDesc = houseManagerDesc ?? this.houseManagerDesc
      ..abilityLabelDesc = abilityLabelDesc ?? this.abilityLabelDesc;
  }
}